﻿@model KnowledgeCommunity.Web.Models.Page
@{
    ViewBag.Title = "Index";
    Layout = null;
}

<div class="contentcontainer">
    <div class="headings">
        <h2>查询</h2>
    </div>
    <div class="contentbox">
        @using (Html.BeginForm("Search", "Document", FormMethod.Post, new { enctype = "multipart/form-data" }))
        {
            <table width="100%" border="0" id="MyTable" cellpadding="0" cellspacing="0">
            <tbody>
            <tr>
                <th>名称</th>
                <td>
                    <input type="text" id="s_title" name="s_title"/>
                </td>
                <th>内容</th>
                <td>
                    <input type="text" id="s_cont" name="s_cont"/>
                </td>
            </tr>
            <tr>
                <th>起始时间</th>
                <td>
                    <input type="text" id="s_time" name="s_time"/>
                </td>
                <th>结束时间</th>
                <td>
                    <input type="text" id="e_time" name="e_time" />
                </td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td>
                    <input type="submit" value=" 查询 >> " class="btn" />
                </td>
            </tr>  
            </tbody>
            </table>
        }
        <div style="clear: both;"></div>
    </div>
</div>
@using (Html.BeginForm("PageIndex", "Document", FormMethod.Post))
 { 
    <div class="contentcontainer">
        <div class="headings altheading">
            <h2>文档列表</h2>
        </div>
        <div class="contentbox">
            <table width="100%">
                <thead>
                    <tr>
                        <th>名称</th>
                        <th>发布者</th>
                        <th>发布时间</th>
                        <th>属性</th>
                        <th>状态</th>
                        <th>价值</th>
                        <th>下载</th>
                        <th>管理</th>
                        <th><input name="" type="checkbox" value="" id="checkboxall" /></th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model.DocumentList)
                    {
                    <tr class="alt">
                        <td>
                            @item.Title
                        </td>
                        <td>
                            @item.Contributor
                        </td>
                        <td>
                            @item.AddTime
                        </td>
                        <td>
                            @Enum.GetName(typeof(KnowledgeCommunity.Service.Enum.IsPublic),item.IsPublic)
                        </td>
                        <td>
                            @Enum.GetName(typeof(KnowledgeCommunity.Service.Enum.State),item.State)
                        </td>
                        <td>
                            @item.Value
                        </td>
                        <td>
                            @item.ReadUrl
                        </td>
                        <td>
                            <a href="@Url.Action("Edit", "Document", new { id=item.Id})" title=""><img src="@Url.Content("~/Content/img/icons/icon_edit.png")" alt="Edit" /></a>
                            <a href="@Url.Action("Details", "Document", new { id=item.Id})" title=""><img src="@Url.Content("~/Content/img/icons/icon_approve.png")" alt="Details" /></a>
                            <a href="@Url.Action("Delete", "Document", new { id=item.Id})" title=""><img src="@Url.Content("~/Content/img/icons/icon_delete.png")" alt="Delete" /></a>
                        </td>
                        <td><input type="checkbox" value="@item.Id" name="checkall" /></td>
                    </tr>
                    }
                </tbody>
            </table>
            <center class="pagination">@Html.Partial("~/Views/Shared/_PageIndex.cshtml", Model)</center> 
            <div style="clear: both;"></div>
        </div>     
    </div>
 }
